<template>
  <div class="home">
    <img alt="Vue logo" src="../assets/logo.png">
    <HelloWorld msg="Welcome to Your Vue.js App"/>
  </div>
</template>

<script>
// @ is an alias to /src
import HelloWorld from '@/components/HelloWorld.vue'

export default {
  name: 'HomeView',
  components: {
    HelloWorld
  },
  mounted(){
    console.log('==> hello world!')

    const sqlite3 = window.require('sqlite3').verbose();
    //创建内存数据库
    let db = new sqlite3.Database(':memory:', (err) => {
      if (err) {
        return console.error(err.message);
      }
      console.log('已经成功连接SQLite数据库');
    });
    db.close()
  }
}
</script>
